<?php
class Response{
    public static function json($code,$message = '',$data = array()){
        if(!is_numeric($code)){
            return '';
        }

        $result = array(
            'code' => $code,
            'message' => $message,
            'data' => $data
        );

        echo json_encode($result);
        exit;
    }
}
/**
 * Created by PhpStorm.
 * User: tuhao
 * Date: 2016/10/18
 * Time: 9:30
 */